package com.sptpc.hellospring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @GetMapping("/hello") //决定端口8080之后输入的内容 eg localhost:8080/hello
    @ResponseBody
    public String hello(@RequestParam(value = "name" ,defaultValue = "Spring") String name) {
        return "Hello," + name;
    }

}
